﻿namespace HRM.CORE
{

    using APP.HELPER.Data.Helper;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;

    public class HRM_TIMEKEEPER_FURLOUGH
    {
        private string m_EmployeeCode;
        private double m_FurloughThisYear;
        private double m_M1;
        private double m_M10;
        private double m_M11;
        private double m_M12;
        private double m_M2;
        private double m_M3;
        private double m_M4;
        private double m_M5;
        private double m_M6;
        private double m_M7;
        private double m_M8;
        private double m_M9;
        private double m_NumberOfYear;
        private double m_RemainDay;
        private double m_TotalDay;
        private double m_YearOfWork;

        public HRM_TIMEKEEPER_FURLOUGH()
        {
            this.m_EmployeeCode = "";
            this.m_YearOfWork = 0.0;
            this.m_NumberOfYear = 0.0;
            this.m_FurloughThisYear = 0.0;
            this.m_M1 = 0.0;
            this.m_M2 = 0.0;
            this.m_M3 = 0.0;
            this.m_M4 = 0.0;
            this.m_M5 = 0.0;
            this.m_M6 = 0.0;
            this.m_M7 = 0.0;
            this.m_M8 = 0.0;
            this.m_M9 = 0.0;
            this.m_M10 = 0.0;
            this.m_M11 = 0.0;
            this.m_M12 = 0.0;
            this.m_TotalDay = 0.0;
            this.m_RemainDay = 0.0;
        }

        public HRM_TIMEKEEPER_FURLOUGH(string EmployeeCode, double YearOfWork, double NumberOfYear, double FurloughThisYear, double M1, double M2, double M3, double M4, double M5, double M6, double M7, double M8, double M9, double M10, double M11, double M12, double TotalDay, double RemainDay)
        {
            this.m_EmployeeCode = EmployeeCode;
            this.m_YearOfWork = YearOfWork;
            this.m_NumberOfYear = NumberOfYear;
            this.m_FurloughThisYear = FurloughThisYear;
            this.m_M1 = M1;
            this.m_M2 = M2;
            this.m_M3 = M3;
            this.m_M4 = M4;
            this.m_M5 = M5;
            this.m_M6 = M6;
            this.m_M7 = M7;
            this.m_M8 = M8;
            this.m_M9 = M9;
            this.m_M10 = M10;
            this.m_M11 = M11;
            this.m_M12 = M12;
            this.m_TotalDay = TotalDay;
            this.m_RemainDay = RemainDay;
        }

        public string Get(int Year, string EmployeeCode)
        {
            string str = "";
            string[] myParams = new string[] { "@Year", "@EmployeeCode" };
            object[] myValues = new object[] { Year, EmployeeCode };
            SqlHelper helper = new SqlHelper();
            SqlDataReader reader = helper.ExecuteReader("HRM_TIMEKEEPER_FURLOUGH_GetListByEmployee", myParams, myValues);
            if (reader != null)
            {
                while (reader.Read())
                {
                    this.m_EmployeeCode = Convert.ToString(reader["EmployeeCode"]);
                    this.m_YearOfWork = Convert.ToDouble(reader["YearOfWork"]);
                    this.m_NumberOfYear = Convert.ToDouble(reader["NumberOfYear"]);
                    this.m_FurloughThisYear = Convert.ToDouble(reader["FurloughThisYear"]);
                    this.m_M1 = Convert.ToDouble(reader["M1"]);
                    this.m_M2 = Convert.ToDouble(reader["M2"]);
                    this.m_M3 = Convert.ToDouble(reader["M3"]);
                    this.m_M4 = Convert.ToDouble(reader["M4"]);
                    this.m_M5 = Convert.ToDouble(reader["M5"]);
                    this.m_M6 = Convert.ToDouble(reader["M6"]);
                    this.m_M7 = Convert.ToDouble(reader["M7"]);
                    this.m_M8 = Convert.ToDouble(reader["M8"]);
                    this.m_M9 = Convert.ToDouble(reader["M9"]);
                    this.m_M10 = Convert.ToDouble(reader["M10"]);
                    this.m_M11 = Convert.ToDouble(reader["M11"]);
                    this.m_M12 = Convert.ToDouble(reader["M12"]);
                    this.m_TotalDay = Convert.ToDouble(reader["TotalDay"]);
                    this.m_RemainDay = Convert.ToDouble(reader["RemainDay"]);
                    str = "OK";
                }
                reader.Close();
                helper.Close();
                reader = null;
            }
            return str;
        }

        public DataTable GetList(int Level, string Code, int Year)
        {
            string[] myParams = new string[] { "@Level", "@Code", "@Year" };
            object[] myValues = new object[] { Level, Code, Year };
            SqlHelper helper = new SqlHelper();
            return helper.ExecuteDataTable("HRM_TIMEKEEPER_FURLOUGH_GetList", myParams, myValues);
        }

        public string AssemblyVersion
        {
            get
            {
                return "1.0.0.0";
            }
        }

        public string Copyright
        {
            get
            {
                return "C\x00f4ng Ty Phần Mềm Ho\x00e0n Hảo";
            }
        }

        [Category("Primary Key"), DisplayName("EmployeeCode")]
        public string EmployeeCode
        {
            get
            {
                return this.m_EmployeeCode;
            }
            set
            {
                this.m_EmployeeCode = value;
            }
        }

        [Category("Column"), DisplayName("FurloughThisYear")]
        public double FurloughThisYear
        {
            get
            {
                return this.m_FurloughThisYear;
            }
            set
            {
                this.m_FurloughThisYear = value;
            }
        }

        [DisplayName("M1"), Category("Column")]
        public double M1
        {
            get
            {
                return this.m_M1;
            }
            set
            {
                this.m_M1 = value;
            }
        }

        [DisplayName("M10"), Category("Column")]
        public double M10
        {
            get
            {
                return this.m_M10;
            }
            set
            {
                this.m_M10 = value;
            }
        }

        [DisplayName("M11"), Category("Column")]
        public double M11
        {
            get
            {
                return this.m_M11;
            }
            set
            {
                this.m_M11 = value;
            }
        }

        [Category("Column"), DisplayName("M12")]
        public double M12
        {
            get
            {
                return this.m_M12;
            }
            set
            {
                this.m_M12 = value;
            }
        }

        [Category("Column"), DisplayName("M2")]
        public double M2
        {
            get
            {
                return this.m_M2;
            }
            set
            {
                this.m_M2 = value;
            }
        }

        [Category("Column"), DisplayName("M3")]
        public double M3
        {
            get
            {
                return this.m_M3;
            }
            set
            {
                this.m_M3 = value;
            }
        }

        [DisplayName("M4"), Category("Column")]
        public double M4
        {
            get
            {
                return this.m_M4;
            }
            set
            {
                this.m_M4 = value;
            }
        }

        [Category("Column"), DisplayName("M5")]
        public double M5
        {
            get
            {
                return this.m_M5;
            }
            set
            {
                this.m_M5 = value;
            }
        }

        [DisplayName("M6"), Category("Column")]
        public double M6
        {
            get
            {
                return this.m_M6;
            }
            set
            {
                this.m_M6 = value;
            }
        }

        [Category("Column"), DisplayName("M7")]
        public double M7
        {
            get
            {
                return this.m_M7;
            }
            set
            {
                this.m_M7 = value;
            }
        }

        [Category("Column"), DisplayName("M8")]
        public double M8
        {
            get
            {
                return this.m_M8;
            }
            set
            {
                this.m_M8 = value;
            }
        }

        [Category("Column"), DisplayName("M9")]
        public double M9
        {
            get
            {
                return this.m_M9;
            }
            set
            {
                this.m_M9 = value;
            }
        }

        [Category("Column"), DisplayName("NumberOfYear")]
        public double NumberOfYear
        {
            get
            {
                return this.m_NumberOfYear;
            }
            set
            {
                this.m_NumberOfYear = value;
            }
        }

        public string Product
        {
            get
            {
                return "Class HRM_TIMEKEEPER_FURLOUGH";
            }
        }

        [DisplayName("RemainDay"), Category("Column")]
        public double RemainDay
        {
            get
            {
                return this.m_RemainDay;
            }
            set
            {
                this.m_RemainDay = value;
            }
        }

        [Category("Column"), DisplayName("TotalDay")]
        public double TotalDay
        {
            get
            {
                return this.m_TotalDay;
            }
            set
            {
                this.m_TotalDay = value;
            }
        }

        [DisplayName("YearOfWork"), Category("Column")]
        public double YearOfWork
        {
            get
            {
                return this.m_YearOfWork;
            }
            set
            {
                this.m_YearOfWork = value;
            }
        }
    }
}

